#pragma once
#include "UIBase.h"
#include "../tools/RichTextEx.h"

class StallUI : public UIBase
{
public:
	StallUI();
	~StallUI();
public:
	static cocos2d::Node* createNode();
	virtual bool init();
	CREATE_FUNC(StallUI);
	Node* m_selectedNode;
	int m_selectedTouchID;
	bool m_bMyselfStall;	//是否是自己的
	ui::ImageView* m_curSelItem;
	vector<Sprite*> m_controlList;
	vector<Sprite*> m_stallList;
	//Node* m_ShopNameBg;
	ui::Text* m_ShopText;
	Node* m_Container;
	Sprite* m_CloseBtn;
	Sprite* m_PeachBtn;	//摆摊按钮
	Sprite* m_BuyBtn;
	Sprite* m_CancelBtn;//取消按钮
	Node* m_ShowItembg;
	ui::Text* m_ItemNameText;
	ui::Text* m_ItemPriceText;
	//出售界面
	Node* m_ItemPriceDlg;
	Sprite* m_DlgOkBtn;
	Sprite* m_DlgCancelBtn;
	ui::TextField* m_DlgSellPriceInput;
	Sprite* m_IngotSelect;
	Sprite* m_GoldSelect;
	//摊位信息
	Node* m_ShopInfoDlg;
	Sprite* m_ShopCloseBtn;
	Sprite* m_ShopOkBtn;
	ui::TextField* m_ShopInfoInput;

public:
	bool TouchDown(Touch* touch);
	void TouchMove(Touch* touch);
	bool TouchUp(Touch* touch);
	void ClickItem(Ref *pSender);

	void AddStallItem(TClientItem* item);

	void ChackMyshopItemOk();
	void opmyshopok();
	void Check();
	void SetMySelf(bool mySelf);

	void Open();							//打开
	void Close();							//关闭
	void RefreshData();					//刷新背包界面数据

	void CleanText();
};

